package model;

//gameobject foosztaly
public class GameObject {
	
	protected int ID;
	//adott gameobject x;y koordinatai
	protected double loc_x;
	
	protected double loc_y;
	//adott gameobject altipusa
	protected String type;
	protected Game game;
	//alapkonstruktor
	public GameObject(Game currgame, String myType){
		game=currgame;
		type=myType;
	}
	//tipus lekerdezese
	public String getType(){
		return type;
	}
	public int getID() {
		return ID;
	}
	public void setID(int iD) {
		ID = iD;
	}
	public void turn(double deg){};

	//iranyvektor fokka konvertalasa
	public double convertDirToAngle(double x, double y){
		if(x>0 && y>=0) return ((Math.atan(y/x)*360)/(2*Math.PI));
		if(x>0 && y<0) return (((Math.atan(y/x)+2*Math.PI)*360)/(2*Math.PI));
		if(x<0) return (((Math.atan(y/x)+Math.PI)*360)/(2*Math.PI));
		if(x==0 && y<0) return 90;
		if(x==0 && y>0)  return 270;
		else return 0;
	}
	
	//a mozgas osmetodusa
	public void move() {}
	
	public double get_x(){
		return loc_x;
	}
	public double get_y(){
		return loc_y;
	}

}
